//
//  BaseNavigationController.swift
//  JunYiStockSelection
//
//  Created by xiaogxjkz on 2021/5/9.
//

import UIKit

class BaseNavigationController: UINavigationController {
    
    
    //MARK: - override
    override func viewDidLoad() {
        super.viewDidLoad()
        
        // Do any additional setup after loading the view.
        self.navigationBar.isHidden = true
        self.toolbar.isHidden = true
    }
    
    override var childForStatusBarHidden: UIViewController? {
        return self.topViewController
    }
    
    override var childForStatusBarStyle: UIViewController? {
        return self.topViewController
    }
}


//MARK: - 屏幕旋转
extension BaseNavigationController {
    open override var shouldAutorotate: Bool {
        get{
            return self.topViewController?.shouldAutorotate ?? true
        }
    }
    
    open override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
        get {
            return topViewController?.supportedInterfaceOrientations ?? .portrait
        }
    }
}
